package com.maiji.cloud.entities.shopingmall;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.elasticsearch.annotations.Field;

import java.util.*;

@NoArgsConstructor
@Data
@Accessors(chain = true)
@Table(name = "shipments_info")
@TableName("shipments_info")
public class ShipmentsInfoEntity {

	@TableId
	@Column(name = "uu_id", type = MySqlTypeConstant.VARCHAR, length = 50, isKey = true)
	private String uuId;

	@Column(name = "nick_name", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String nickName;

    @Column(name = "order_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String orderId; // 订单id

    @Column(name = "order_no", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String orderNo; // 订单编号

    @Column(name = "weight_total", type = MySqlTypeConstant.INT, length = 1)
    private Integer weightTotal; // 订单商品总重(克)

    @Column(name = "weight", type = MySqlTypeConstant.INT, length = 1)
    private Integer weight; // 物流重量

	@Column(name = "express_count", type = MySqlTypeConstant.INT, length = 1)
	private Integer expressCount; // 订单发货运单数量
	
	@Column(name = "company_code", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String companyCode; // 快递公司编码
	
	@Column(name = "company_name", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String companyName; // 快递公司名称
	
	@Column(name = "express_no", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String expressNo; // 运单号

	@Column(name = "consignee", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String consignee; // 发货人

	@Column(name = "tel", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String tel; // 发货电话

	@Column(name = "send_address", type = MySqlTypeConstant.VARCHAR, length = 50)
	private String sendAddress; // 发货地址

	@Column(name = "express_status", type = MySqlTypeConstant.BIT)
	private Boolean expressStatus; // 发货状态

	@Column(name = "print_date", type = MySqlTypeConstant.DATETIME)
	private Date printDate; // 发货状态

	@Column(name = "send_date", type = MySqlTypeConstant.DATETIME)
	private Date sendDate; // 发货状态

    @Column(name = "img_base64", type = MySqlTypeConstant.LONGTEXT)
    private String imgBase64; // 电子面单

    @TableField(exist = false)
    private Boolean remindSend; // 提醒发货

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShipmentsInfoEntity that = (ShipmentsInfoEntity) o;
        return Objects.equals(uuId, that.uuId) || Objects.equals(expressNo, that.expressNo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(expressNo);
    }

}
